<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title><%=VITE_APP_TITLE%></title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.ts"></script>
    <script type="module">
      // 使用动态导入来获取环境变量
      const redirectUri = new URL('/login/callback', import.meta.env.VITE_APP_API_BASE_URL || 'http://localhost:3000').href;
      
      // 创建 script 标签并设置属性
      const qqScript = document.createElement('script');
      qqScript.src = 'https://connect.qq.com/qc_jssdk.js';
      qqScript.setAttribute('data-appid', '102015968');
      qqScript.setAttribute('data-redirecturi', redirectUri);
      
      document.body.appendChild(qqScript);
    </script>
  </body>
</html>
